package com.qf.mpswaggershiro.product.controller;

import com.qf.mpswaggershiro.product.entity.Product;
import com.qf.mpswaggershiro.product.service.IProductImgService;
import com.qf.mpswaggershiro.product.service.IProductService;
import com.qf.mpswaggershiro.vo.Vo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品 商品信息相关表：分类表，商品图片表，商品规格表，商品参数表 前端控制器
 * </p>
 *
 * @author cui
 * @since 2023-02-13
 */
@RestController
@RequestMapping("/index")
@CrossOrigin
public class ProductController {

    @Autowired
    IProductImgService productImgService;
    @Autowired
    IProductService productService;

    @GetMapping("/list-recommends")
    public Vo getProduct(){

       List<Product> data= productService.listProduct();

        return Vo.ok(data);

    }

}
